<?php
	$host = "localhost";
	$username = "root";
	$password = "";
	$databasename = "Newgame";

	//增删改
	function zsg($sql){
		global $host,$username,$password,$databasename;
		$mysqli = new mysqli($host,$username,$password,$databasename);
		$mysqli -> query("SET NAMES uft8");
		$mysqli -> query($sql);
		$mysqli -> close();
	}

	//查
	function cha($sql){
		global $host,$username,$password,$databasename;
		$mysqli = new mysqli($host,$username,$password,$databasename);
		$mysqli -> query("SET NAMES uft8");
		$results = $mysqli -> query($sql);
		$rs = array();
		$i = 0;
		while ($row = $results -> fetch_array()) {
			$rs[$i++] = $row;
		}
		$results -> close();
		$mysqli -> close();
		return $rs;
	}

?>